#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Class.h"
#include "DeploymentTarget.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {

/// <summary>
/// Node
/// A Node is computational resource upon which artifacts may be deployed for
/// execution. Nodes can be interconnected through communication paths to define
/// network structures.
/// </summary>
class UMLMODEL_EXPORT Node : public DeploymentTarget, public Class {

public: // Constructors and destructors
    explicit Node(const QString& umlType="uml::Node");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// nestedNodes getter
    /// The Nodes that are defined (nested) within the Node.
    /// </summary>
    vector<shared_ptr<Node>>& nestedNodes();

private: // Fields
    /// <summary>
    /// nestedNodes
    /// The Nodes that are defined (nested) within the Node.
    /// </summary>
    vector<shared_ptr<Node>> nestedNodes_;

};

} // namespace uml
